package com.itheima.dao;

import com.itheima.pojo.PageInfo;
import com.itheima.pojo.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface ContactMapper {
    @Select("select * from student limit #{startIndex}, #{pageSize}")
    List<Student> findByPage(@Param("startIndex") int startIndex, @Param("pageSize") int pageSize);

    @Select("select * from student")
    List<Student> findAll();

    @Select("select * from student where number = #{number}")
    Student findByNumber(String number);

    @Insert("insert student values (#{number},#{name},#{birthday},#{address})")
    int addStu(Student stu);

    @Delete("delete from student where number = #{number}")
    int delete(String number);

    @Update("update student set name = #{name}, birthday = #{birthday}, address = #{address} where number = #{number}")
    int update(Student stu);
}
